<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Policy extends Model
{
    //
    use SoftDeletes;

    protected $table = 'policy';
    protected $guarded = [];


    /**
     * 属于哪个平台
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function booking(){

        return $this->belongsTo(Booking::class,'booking_id','id');
    }

    /**
     * 舱位设置
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function cabin_set(){

        return $this->hasMany(CabinSet::class,'policy_id','id');
    }

    /**
     * 舱位设置
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function rule_set(){

        return $this->hasMany(RuleSet::class,'policy_id','id');
    }

    /**
     * 产品标识
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function product_mark(){

        return $this->hasMany(PolicyProductMark::class,'policy_id','id');
    }
}
